package com.shhimto.member.client.ui;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Cursor;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.Widget;

public class MemberDetailPopUp extends PopupPanel {
	@UiTemplate("MemberDetailPopUp.ui.xml")
	
	interface MemberDetailsUiBinder extends UiBinder<Widget, MemberDetailPopUp> {}
	private static MemberDetailsUiBinder uiBinder = GWT.create(MemberDetailsUiBinder.class);
 
	@UiField DockLayoutPanel memberDetailPanel ;
	@UiField Image detailClose ;
	
	 
	public MemberDetailPopUp() {
		super(true) ;
		add(uiBinder.createAndBindUi(this));
		this.setGlassEnabled(true);
		
		detailClose.getElement().getStyle().setCursor(Cursor.POINTER);
		
		MemberDetailHeader memberDetailHeader = new MemberDetailHeader() ;
		memberDetailPanel.addNorth(memberDetailHeader.getMemberDetailHeader(), 12);
		
		FamilyMembers familyMembers = new FamilyMembers() ;
		memberDetailPanel.addEast(familyMembers.getFamilyMembers(), 15);
		
		MemberDetail memberDetail = new MemberDetail() ;
		memberDetailPanel.add(memberDetail.getMemberDetail());
	}
	
	@UiHandler("detailClose")
	void onClick(ClickEvent clickEvent){
		this.hide();
	}
	
}
